<template>
 <h1>
    双向绑定
 </h1>

<!--  v-mode  -->

  <input type="text "  placeholder="姓名" v-model="user.name">
  <input type="text" placeholder="年龄" v-model="user.age">
  <input type="radio" name="gender" v-model="ref.gender"> 男
  <input type="radio" name="gender" v-model="ref.gender"> 女

  <button @click="reg"></button>


</template>


<script setup>
import {ref} from "vue";
const user = ref ({
  name : "",
  age : "",
  gender : ""
});

const reg = ()=>
{
  console.log(user.value)
  console.log(user.value.name)
  console.log(user.value.age)
  console.log(user.value.gender)
}

</script>


<style scoped>

</style>